<script setup>
import MonthPicker from "@/components/datepicker/MonthPicker.vue";

function getMonth() {
  let month = `${new Date().getMonth() + 1}`;
  if (month.length < 2) {
    month.padStart(1, "0");
  }
  return month;
}

const startYear = defineModel("startYear", `${new Date().getFullYear}`);
const endYear = defineModel("endYear", `${new Date().getFullYear}`);
const startMonth = defineModel("startMonth", `${getMonth()}`);
const endMonth = defineModel("endMonth", `${getMonth()}`);

</script>

<template>
  <MonthPicker yearLabel="开始年份" monthLabel="开始月份" v-model:year="startYear" v-model:month="startMonth"> </MonthPicker>
  <MonthPicker yearLabel="结束年份" monthLabel="结束年份" v-model:year="endYear" v-model:month="endMonth"></MonthPicker>
</template>